package cn.sytton.taffe.framework.util;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

/**
 * 数组工具类
 *
 * @author skyrock
 */
public class ArrayUtil {

    /**
     * 转换从前端进来的数组参数, 例如："00213D95%2C00834217" => ["00213D95","00834217"]
     * @param text 字符串
     */
    public static String[] string2Array(String text) {
        try {
            return URLDecoder.decode(text, "utf-8").split(",");
        } catch (UnsupportedEncodingException e) {
            return null;
        }
    }
}
